Skip to content

Static file, URL, and entrypoint#16

Merged
akbargumbira merged 5 commits intoid-python:developfrom
iromli:static
Jul 7, 2014
Merged

Static file, URL, and entrypoint#16
akbargumbira merged 5 commits intoid-python:developfrom
iromli:static

Conversation

@iromli
Copy link
Copy Markdown
Member

@iromli iromli commented Jul 5, 2014

The changesets introduce Flask builtin url_for callable to resolve URL. This eliminates hardcoded URL in email and HTML templates. Also, since url_for resolves everything for us, users/static.py is no longer needed.

As a bonus, a new entrypoint named manage.py is included to replace runserver.py.

usage: manage.py [-?] {shell,runserver} ...

positional arguments:
  {shell,runserver}
    shell            Runs a Python shell inside Flask application context.
    runserver        Runs the Flask development server i.e. app.run()

optional arguments:
  -?, --help         show this help message and exit

Example:

USERS_CONFIG=/path/to/config.py USERS_DEBUG=1 python manage.py runserver

It's worth to remember, neither manage.py nor runserver.py is suitable for production environment.

@akbargumbira
Copy link
Copy Markdown
Member

Looks good to me. There is caveat that I forgot on using url_for. We used url_for before and changed it to use the configuration instead kartoza@83ddf1f

@akbargumbira
Copy link
Copy Markdown
Member

Oh the issue was kartoza#19

@iromli
Copy link
Copy Markdown
Member Author

iromli commented Jul 7, 2014

Was that running behind proxy (e.g. nginx) or straight docker port forwarding ??

@iromli
Copy link
Copy Markdown
Member Author

iromli commented Jul 7, 2014

For example for production deployment we have the user map deployed in a docker container with mod_proxy on the host.

Oh ok, it's using proxy.

That's strange, i never had issue like this even when running on server with private IP — nginx as frontend, KVM

@iromli
Copy link
Copy Markdown
Member Author

iromli commented Jul 7, 2014

@akbargumbira ok, reverted

akbargumbira added a commit that referenced this pull request Jul 7, 2014
Static file, URL, and entrypoint
@akbargumbira akbargumbira merged commit 01b6e67 into id-python:develop Jul 7, 2014
@iromli iromli deleted the static branch July 7, 2014 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants